//App.js
import { useState } from 'react';
import "./App.css";
import CesiumViewer from "./components/CesiumViewer";
import MenuBar from "./components/MenuBar";
import MessageBox from "./components/MessageBox";

function App() {
  const [showMessageBox, setShowMessageBox] = useState(true);
  const messageContent = `系统状态：
- 当前时间：${new Date().toLocaleString()}
- 地图加载完成
- 数据连接正常`;

  const toggleMessageBox = () => {
    setShowMessageBox(!showMessageBox);
  };

  return (
    <div className="App">
      <CesiumViewer />
      <MenuBar
        showMessageBox={showMessageBox}
        onToggleMessageBox={toggleMessageBox}
      />
      {showMessageBox && (
        <MessageBox
          content={messageContent}
          onClose={() => setShowMessageBox(false)}
        />
      )}
    </div>
  );
}

export default App;
